package com.carrental.search.config;

import io.swagger.v3.oas.models.ExternalDocumentation;
import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.info.Contact;
import io.swagger.v3.oas.models.info.Info;
import io.swagger.v3.oas.models.info.License;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * OpenAPI文档配置类
 * 用于配置API文档
 */
@Configuration
public class OpenApiConfig {

    /**
     * 创建OpenAPI配置
     * @return OpenAPI
     */
    @Bean
    public OpenAPI carRentalOpenAPI() {
        return new OpenAPI()
                .info(new Info()
                        .title("汽车租赁平台-搜索服务API文档")
                        .description("汽车租赁平台-搜索服务API文档")
                        .version("1.0.0")
                        .contact(new Contact()
                                .name("CarRental")
                                .url("https://www.carrental.com")
                                .email("admin@carrental.com"))
                        .license(new License()
                                .name("Apache 2.0")
                                .url("https://www.apache.org/licenses/LICENSE-2.0.html")))
                .externalDocs(new ExternalDocumentation()
                        .description("汽车租赁平台文档")
                        .url("https://www.carrental.com/docs"));
    }
} 